package com.bafa.services;

import java.sql.Date;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Calendar;

import com.bafa.jdbc.DBAccess;
import com.bafa.jdbc.QueryObject;
import com.bafa.objects.Message;

public class RequestServices {

	public static Message requestReschedule(int matchIdFrom, int day, int month, int year, int teamId){
		
		Calendar calendar = Calendar.getInstance();
		calendar.set(year,month,day);
		
		Date date = new Date(calendar.getTimeInMillis());
		
		DBAccess db = new DBAccess();
		QueryObject query = new QueryObject("matches");
		query.addWhereAndField("Date",year+"-"+month+"-"+day);
		try{
			ArrayList emails = new ArrayList();
			ResultSet result = db.query(query);
			while(result.next()){
				String email1 = result.getString("ContactEmail1");
				String email2 = result.getString("ContactEmail2");
				emails.add(email1);
				emails.add(email2);
			}
			
			emails.add("bafa.bafa@ba.com");
			
			
		}catch(Exception e){
			
		}finally{
			db.disconnect();
		}
		
		return null;
	}
}
